package org.jeecg.modules.mall.job;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.mall.service.ITbMnOrderService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 每天凌晨，将未结算的订单重新查询一遍，进行更新
 * </p>
 * 11/12
 */
@Slf4j
public class OrderUpdateTask implements Job {
    private String parameter;

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    @Autowired
    private ITbMnOrderService tbMnOrderService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("淘宝订单数据 ,dateTime:{}", DateUtils.now());
        try {
            tbMnOrderService.queryOrderByTask(this.parameter);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
        log.info("淘宝订单数据,dateTime:{}", DateUtils.now());
    }
}
